﻿<%@ Page Language="C#" MasterPageFile="~/EasyUI.master" AutoEventWireup="true" CodeBehind="Show.aspx.cs" Inherits="jnpic.Web.userinfo.Show" Title="显示页" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(function () {
            $.ajax({
                type: "post",
                dataType: "json",
                url: "GetUser.ashx?action=myinfo",
                success: function aa(data) {
                    $("#uname").text(data.rows[0].uname);
                    $("#uprovince").text(data.rows[0].uprovince + data.rows[0].ucity + data.rows[0].ucounty);
                    $("#uunit").text(data.rows[0].uunit);
                    $("#utruename").val(data.rows[0].utruename);
                    $("#uphone").val(data.rows[0].uphone);
                    $("#uemail").val(data.rows[0].uemail);
                    $("#utel").val(data.rows[0].utel);
                    $("#uadd").val(data.rows[0].uadd);
                }
            });
            $('#dlg').dialog({
                onClose: function () {
                    top.closeTab('本账户信息管理');
                }
            });
            $('#dlg').dialog('open').dialog('setTitle', '本帐户信息');
            

        });
        function saveUser() {
            $('#fm').form('submit', {
                url: "GetUser.ashx?action=updatemyinfo",
                onSubmit: function () {
                    return $(this).form('validate');
                },
                success: function (result) {
                    if (result.indexOf("T") == 0) {                        
                        $.messager.alert("提示", "恭喜您，信息修改成功", "info");
                    }
                    else if ((result.indexOf("F") == 0)) {
                        $.messager.alert("提示", "修改失败，请重新操作！", "info");
                        return;
                    }
                    else if ((result.indexOf("L") == 0)) {
                        $.messager.alert("提示", "长时间没有操作，请重新登录！", "info");
                        top.location = '/index.aspx';
                        return;
                    }
                }
            });
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   <div id="dlg" class="easyui-dialog" style="width: 500px; height: auto; padding: 10px 20px"
            data-options="draggable:false,resizable:false,buttons:'#dlg-buttons',shadow:false">

                        <form id="fm" method="post">

                <div class="fitem">
                    <label>用户名：</label>
                    <span id="uname"  ></span>
                </div>
                             <div class="fitem" id="dprovince">
                    <label>地区：</label>
                    <span id="uprovince" />
                </div>               
                <div class="fitem">
                    <label>单位：</label>
                    <span id="uunit"  />
                </div>                            
                <div class="fitem">
                    <label>负责人姓名：</label>
                    <input id="utruename" name="utruename" class="easyui-validatebox" data-options="required:true" />
                </div>
                <div class="fitem">
                    <label>手机：</label>
                    <input id="uphone" name="uphone" class="easyui-validatebox" data-options="required:true" />
                </div>
                <div class="fitem">
                    <label>邮箱：</label>
                    <input id="uemail" name="uemail" class="easyui-validatebox" data-options="required:true,validType:'email'" />
                </div>
                
                <div class="fitem">
                    <label>单位电话：</label>
                    <input id="utel" name="utel" class="easyui-validatebox" data-options="required:true" />
                </div>                
               
                <div class="fitem">
                    <label>地址：</label>
                    <input id="uadd" name="uadd" class="easyui-validatebox" />
                </div>                
            </form>

        </div>
        <div id="dlg-buttons">
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="saveUser()">保存</a>
            
        </div>
</asp:Content>
<%--<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceCheckright" runat="server">
</asp:Content>--%>




